﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SuperX.Common.Attributes
{
    // API特性
    [AttributeUsage(AttributeTargets.Method)]
    public class APIAttribute : Attribute
    {
        // 注释
        public string Summary { get; set; }

        // 参数
        public string[] Params { get; set; }

        // 返回结果描述
        public string Returns { get; set; }

        public APIAttribute()
        {
        }

        public APIAttribute(string summary, string returns, params string[] paramsDesc)
        {
            this.Summary = summary;
            this.Returns = returns;
            this.Params = paramsDesc;
        }
    }

    [AttributeUsage(AttributeTargets.Property)]
    public class TableColumnAttribute : Attribute
    {
        /// <summary>
        /// 描述
        /// </summary>
        private string _ColumnDescription;

        public string ColumnDescription
        {
            get { return _ColumnDescription; }
            set { _ColumnDescription = value; }
        }

        /// <summary>
        /// 是否必填
        /// </summary>
        private bool _IsRequire;

        public bool IsRequire
        {
            get { return _IsRequire; }
            set { _IsRequire = value; }
        }

        /// <summary>
        /// 是否不反射
        /// </summary>
        private bool _IsIgnore;

        public bool IsIgnore
        {
            get { return _IsIgnore; }
            set { _IsIgnore = value; }
        }

        /// <summary>
        /// 外键
        /// </summary>
        private string _ForeignKey;

        public string ForeignKey
        {
            get { return _ForeignKey; }
            set { _ForeignKey = value; }
        }

        /// <summary>
        /// 是否主键
        /// </summary>
        private bool _IsPrimaryKey;

        public bool IsPrimaryKey
        {
            get { return _IsPrimaryKey; }
            set { _IsPrimaryKey = value; }
        }
    }
}